<template>
  <div class="getBack">
    <div @click="onClickLeft"> <van-icon name="arrow-left"/> 返回</div>
    <h4>{{ titles }}</h4>
    <div @click="onClickRight" :class="{visibilityShow:this.$store.state.isLogin}">去登陆
<!--      <van-icon name="https://b.yzcdn.cn/vant/icon-demo-1126.png" />-->
    </div>
  </div>
</template>

<script>

export default {
  name: "GetBack",
  props: {
    titles: String
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    onClickRight() {
      this.$router.push("/Logining")
    },
  },
  created() {
    console.log(this.$store.state.isLogin)
  },
  computed:{
    // isLogin(){
    //   return this.$store.state.isLogin
    // }
  }
}
</script>

<style lang="less" scoped>
.getBack{
  margin-bottom: 50px;
  position: fixed;
  top: 0;
  left: 0;
  height: 50px;
  width: 100%;
  color: #fa946d;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
  .visibilityShow{
    visibility: hidden;
  }
  .van-icon{
    vertical-align: middle;
  }
  h4{
    color: orangered;
  }
}
</style>